package priv.pront.code.mati.province;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-11-11 14:12
 */
public class MC0102_房间打扫 {

    static int n;
    static Map<String, Integer> map = new HashMap<>();
    static int max = 1;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        for (int i = 0; i < n; i++) {
            String s = scanner.next();
            if (map.containsKey(s)) {
                for (Map.Entry<String, Integer> cur : map.entrySet()) {
                    String key = cur.getKey();
                    if(key.equals(s)) map.put(key, map.get(key) + 1);
                }
            }else{
                map.put(s, 1);
            }
        }
        for (Map.Entry<String, Integer> cur : map.entrySet()) {
            Integer value = cur.getValue();
            max = Math.max(max, value);
        }

        System.out.println(max);
    }
}
